<template>
	<view class="contents">
		<view class="back">
			<image src="../../static/back.png" mode="" @click="backPrePage"></image>
		</view>
		<view class="" style="height: 60rpx;"></view>
		<view class="header">
			<view class="status">
				<text>待核销</text>
			</view>
			<view class="prompt">
				<text>报名成功,请在活动时间内到活动地点核销</text>
			</view>
		</view>
		<view class="activity">
			<view class="newactivities">
				<view class="left">
					<image :src="activeFrom.image" mode=""></image>
				</view>
				<view class="right">
					<view class="eventname">
						<text>{{activeFrom.title}}</text>
					</view>
					<view class="eventprice">
						<text>￥{{activeFrom.price}}</text>
					</view>
				</view>
			</view>
		</view>
		<view class="information">
			<view class="header">
				<view class="info">
					<view class="tits"></view>
					<text>核销信息</text>
				</view>
			</view>
			<view class="main">
				<view class="item">
					<view class="title">
						活动时间:
					</view>
					<view class="detail date">
						{{activefrom.day}}
					</view>
				</view>
				<view class="item">
					<view class="title">
						活动地点:
					</view>
					<view class="detail">
						{{activeFrom.province +activeFrom.city +activeFrom.district +activeFrom.detail  }}
					</view>
				</view>
				<view class="item">
					<view class="title">
						活动状态:
					</view>
					<view class="detail">
						活动未开始
					</view>
				</view>
				<view class="item">
					<view class="title">
						核销状态:
					</view>
					<view class="detail">
						未核销
					</view>
				</view>
			</view>
			<view class="couponcode">
				<view class="code">
					<image :src="activefrom.write_off_code" mode=""></image>
				</view>
				<view class="coupon">
					券码 408559
				</view>
			</view>
		</view>
		
		<view class="information">
			<view class="header">
				<view class="info">
					<view class="tits"></view>
					<text>订单信息</text>
				</view>
			</view>
			<view class="main">
				<view class="item">
					<view class="title">
						姓名:
					</view>
					<view class="detail">
						{{activefrom.user_info.name}}
					</view>
				</view>
				<view class="item">
					<view class="title">
						手机号:
					</view>
					<view class="detail">
						{{activefrom.user_info.phone}}
					</view>
				</view>
				<view class="item">
					<view class="title">
						人数:
					</view>
					<view class="detail">
						2人
					</view>
				</view>
				<view class="item">
					<view class="title">
						订单编号:
					</view>
					<view class="detail">
						{{activefrom.order_id}}
					</view>
				</view>
				<view class="item">
					<view class="title">
						支付时间:
					</view>
					<view class="detail">
						{{activefrom.pay_time}}
					</view>
				</view>
				<view class="item">
					<view class="title">
						支付金额:
					</view>
					<view class="detail">
						￥{{activefrom.pay_price}}
					</view>
				</view>
			</view>
			
			
		</view>
	</view>
</template>

<script>
	import {activeOrderDetail,getOrderDate} from '@/api/api.js'
	export default {
		data() {
			return {
				orderId:'',
				activeFrom:{},
				activefrom:{}
			}
		},
		onLoad(options) {
			this.orderId = options.order_id
			this.activeOrderDetail(this.orderId)
		},
		methods: {
			activeOrderDetail(id){
				let data = `order_id=${id}`
				activeOrderDetail(data).then(res=>{
					this.activeFrom = res.data.data.activity
					this.activefrom = res.data.data
				})
			},
			
			backPrePage() {
				uni.navigateBack()
			}

		}
	}
</script>

<style lang="scss">
	.contents {
		width: 100%;
		min-height: 100vh;
		background-color: rgb(247, 249, 252);
		background-image: linear-gradient(180deg, #1AB374 100rpx, #F7F9FC 500rpx);
		.back {
			width: 36rpx;
			height: 36rpx;
			position: fixed;
			left: 36rpx;
			top: 110rpx;
			image {
				width: 100%;
				height: 100%;
			}
		}

		.header {
			color: #fff;
			margin: auto 28rpx;
			padding-left: 12rpx;
			margin-top: 160rpx;

			.status {
				font-size: 32rpx;
				font-weight: 600;
			}

			.prompt {
				font-size: 28rpx;
				margin-top: 28rpx;
			}
		}

		.activity {
			width: 694rpx;
			// height: 250rpx;
			background-color: #fff;
			border-radius: 10rpx;
			margin: 35rpx auto 0;

			.newactivities {
				box-sizing: border-box;
				padding: 36rpx;
				width: 100%;
				display: flex;

				.left {
					width: 220rpx;
					height: 140rpx;
					flex-shrink: 0;

					image {
						border-radius: 8rpx;
						width: 100%;
						height: 100%;
					}
				}

				.right {
					width: 360rpx;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					margin-left: 24rpx;

					.eventaddress {
						font-size: 26rpx;
						color: #999;
						display: flex;
						align-items: center;

						image {
							width: 36rpx;
							height: 36rpx;
						}

						text {
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
							-o-text-overflow: ellipsis;
						}
					}

					.eventprice {
						color: #ED742E;
						font-weight: 600;
					}
				}
			}
		}

		.information {
			width: 694rpx;
			// height: 250rpx;
			background-color: #fff;
			border-radius: 10rpx;
			margin: -136rpx auto 0;
			font-size: 28rpx;

			// display: flex;
			.header {
				box-sizing: border-box;
				padding: 26rpx 0;
				// width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				// font-size: 28rpx;
				border-bottom: 2rpx solid rgb(247, 249, 252);
				.info {
					display: flex;
					color: #000;
					.tits{
						width: 8rpx;
						height: 34rpx;
						background-color: #4A8CF7;
						border-radius: 4rpx;
						// margin-left: 16rpx;
						margin-right: 10rpx;
					}
				}

				.status {
					color: #ED742E;
					font-weight: 600;
				}
			}
			.main {
				box-sizing: border-box;
				padding: 28rpx;
				.item {
					display: flex;
					margin-bottom: 28rpx; 
					.title {
						width: 140rpx;
						margin-right: 28rpx;
					}
					.date {
						color: #4A8CF7;
					}
				}
			}
			.couponcode {
				width: 100%;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				image {
					width: 250rpx;
					height: 250rpx;
				}
				.coupon {
					margin-top: 40rpx;
					margin-bottom: 60rpx;
				}
			}

		
		}
	}
</style>
